﻿namespace NEvoWeb.Modules.NB_Store
{
    using DotNetNuke.Entities.Portals;
    using Microsoft.VisualBasic;
    using System;
    using System.Web;

    public abstract class InternalUpdateInterface
    {
        private static InternalUpdateInterface objProvider = null;

        static InternalUpdateInterface()
        {
            CreateProvider();
        }

        protected InternalUpdateInterface()
        {
        }

        public abstract void AutoResponse(int PortalID, HttpRequest Request);
        public abstract void BankRemotePost(int PortalID, NB_Store_CartInfo cart, string Lang, HttpRequest Request);
        private static void CreateProvider()
        {
            string storeSetting = SharedFunctions.GetStoreSetting(((PortalSettings) HttpContext.Current.Items["PortalSettings"]).PortalId, "InternalUpdate.provider");
            if (storeSetting != "")
            {
                string[] strArray = Strings.Split(storeSetting, ",", -1, CompareMethod.Binary);
                objProvider = (InternalUpdateInterface) Activator.CreateInstance(strArray[0], strArray[1]).Unwrap();
            }
        }

        public static InternalUpdateInterface Instance()
        {
            return objProvider;
        }

        public abstract string ReturnToStore(int PortalID, NB_Store_CartInfo cart, string Lang, HttpRequest Request);
    }
}

